<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="renderer" content="webkit"> 
	<meta content="always" name="referrer">
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <link rel="stylesheet" type="text/css" href="css/style.css"/>
  <link rel="stylesheet" type="text/css" href="lib/layui/css/layui.css"/>
  <script src="js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="lib/layui/layui.js" type="text/javascript" charset="utf-8"></script>
	<script src="js/ajaxSet.js" type="text/javascript" charset="utf-8"></script>
	<style type="text/css">
		.layui-form-checked span, .layui-form-checked:hover span{
			background-color:#FF0000!important;
			}
			#demoBtn{
				background-color: #FF0000;
			}
			.layui-form-checked i, .layui-form-checked:hover i {
			    color: #ff0000!important;
			}
			.layui-form-checked, .layui-form-checked:hover {
			    border-color: #ff0000!important;
			}
	</style>
</head>
<body  style="margin-left:auto;margin-right:auto;width: 80%;">
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 10px;">
<legend>申请退款</legend>
</fieldset>
<form class="layui-form layui-form-pane" action="" >
  <div class="layui-form-item layui-form-text">
    <label class="layui-form-label">退款原因:</label>
    <div class="layui-input-block">
      <textarea placeholder="写点东西吧，我们希望知道您的退款原因，方便管理员审核^_^" class="layui-textarea" id="refund"></textarea>
    </div>
  </div>
  <!--<div class="layui-form-item">
    <label class="layui-form-label">联系方式:</label>
    	<div class="layui-input-block">
      <input type="text" name="link" id="link" autocomplete="off" placeholder="请留下联系方式，以便我们及时联系您" class="layui-input">
    </div>
  </div>-->
  <div class="layui-form-item" style="margin-top: 100px; margin-left:auto;margin-right:auto;width: 10%;">
    <button class="layui-btn" lay-submit="" lay-filter="demo2" id="demoBtn">提交</button>
  </div>
</form>
          
<script src="js/wang.js" type="text/javascript" charset="utf-8"></script>
<script>
	layui.use(['form', 'layedit', 'laydate'], function(){
	  var form = layui.form
	  ,layer = layui.layer;
	$("#demoBtn").on("click",function(){
		var json = JSON.parse(localStorage.getItem("token"));
	    $.ajax({
		    type:"post",
		    url:"http://52lvu.cn:8080/api/order/updateOrderStatus",
		    data:{
		        userId : wang.getQueryString("userId"),
		        id : wang.getQueryString("orderId"),
		        refund : $("#refund").val(),
		        token : json.token
		    },success : function (result){

						var index=parent.layer.getFrameIndex(window.name);
						parent.layer.close(index);
		    },error : function (e){
		        layur.msg("请求错误,请稍后重试",{icon:2,time:2000})
		    }
		});
		return false;
	})
})
</script>

</body>
</html>